#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>

int main(int argc, char **argv)
{
	int fd;
	int val;

	if (!argv[1])
	    return -1;

	fd = open(argv[1], O_RDWR);

	if (fd == -1)
	    return -2;

	while(1)
	{
	    read(fd, &val, 4);
	    printf("val = %04x\n", val);
	}

	close(fd);
	return 0;
}
